package com.somedemo.java_design_patterns_demo.factory;

import com.somedemo.java_design_patterns_demo.factory.abs_factory.MacBookFactory;
import com.somedemo.java_design_patterns_demo.factory.abs_factory.PhoneFactory;
import com.somedemo.java_design_patterns_demo.factory.abs_method.MacBook1;
import com.somedemo.java_design_patterns_demo.factory.abs_method.Phone1;


public class TestMain {
    public static void main(String[] args) {
        //工厂方法模式  创建方式复杂
        MacBookFactory macBookFactory = new MacBookFactory();
        macBookFactory.getProduct();
        PhoneFactory phoneFactory = new PhoneFactory();
        phoneFactory.getProduct();
        //简单工厂模式
        MacBook1 macBook1 = new MacBook1();
        macBook1.getProduct();
        Phone1 phone1 = new Phone1();
        phone1.getProduct();

    }
}
